<script>
  import init from "./index";
  import wallet from "./common/wallet";

  export default {
		onLaunch: async function () {
      uni.setTabBarItem({
        index: 0,
        text: this.$t('首页')
      })
      uni.setTabBarItem({
        index: 1,
        text: this.$t('卡牌')
      })
      uni.setTabBarItem({
        index: 2,
        text: this.$t('钱包')
      })
      uni.setTabBarItem({
        index: 3,
        text: this.$t('签到')
      })
      uni.setTabBarItem({
        index: 4,
        text: this.$t('团队')
      })
      console.log('onLaunch')
      const address = await wallet.getAddress();
      const localeAddress = uni.getStorageSync("localeAddress");
      if (address !== localeAddress) {
        await init.initAddress();
      }
    },
		onShow: async function () {
      console.log('App Show')
    },
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang="scss">
/*每个页面公共css */
@import 'uview-ui/index.scss';
@import 'style/base.css';
@import 'style/flex.css';
@import 'style/position.css';
@import 'style/text.css';

body {
	min-height: calc(100vh - var(--window-bottom) - var(--window-top));
	background: url("./static/bg.png") no-repeat;
	background-size: 100% 100%;
}
</style>
